<?php
/* @var $this ListViewController */

$this->breadcrumbs=array(
	'List View',
);
?>
<h1>List of All Properties</h1>

<table>
<tr><th bgcolor=#d60c0c><font color=white>Projects</font></th><th bgcolor=#d60c0c><font color=white>Properties</font></th></tr>
<?php 
$i=1;
foreach($projects as $project){
	echo '<tr>';
	echo '<td><b>'. $i .'. </b>'. CHtml::link($project->name, array('project/view', 'id'=>$project->id)) .'</td>';
	echo '<td></td>';
	echo '<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
	echo '</tr>';
	$prop = new Property;
	$properties = $prop->getPropertyByProjectID($project->id);
	foreach($properties as $property){
		echo '<tr>';
		echo '<td></td>';
		echo '<td> - '. CHtml::link($property->unit_number, array('property/view', 'id'=>$property->id)) .'</td>';
		echo '<td></td>';
		echo '</tr>';
	}
	$i++;
}
?>
</table>
